package com.principle.ocp;

/**
 * @author yangguanzan
 * @date 3/10/22
 * @description
 */
public class NovelBook implements IBook {

    private String name;

    private Integer price;

    private String author;

    public NovelBook(String name, int price, String author) {
        this.name = name;
        this.price = price;
        this.author = author;
    }

    @Override
    public String getName() {
        return this.name;
    }

    @Override
    public int getPrice() {
        if(null == this.price){
            return 0;
        }
        return this.price.intValue();
    }

    @Override
    public String getAuthor() {
        return this.author;
    }
}
